package com.springboot.controller;

import com.springboot.bean.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/************************************************************************
 *
 *    Copyright  Copyright 2021 Google Inc.
 *    File Name: HelloController
 *    Description: 描述
 *
 *    Version: V1.0
 *    Author: Fuc
 *    Create Time: 2021-01-13
 *
 *************************************************************************/

@RestController
public class HelloController {

  @Value("${person.name:李四}")
  private String name;

  @Autowired private Person person;

  @Value("${MAVEN_HOME}")
  private String msg;

  @Value("${os.name}")
  private String osName;

  @GetMapping("/")
  public String hello() {

    return person.getClass().toString();
  }

  @GetMapping("/person")
  public Person person() {

    return person;
  }

  @GetMapping("/msg")
  public String getMsg() {
    return msg + "==>" + osName;
  }
}
